package com.atguigu.eduservice.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author shkstart
 * @create 2022-08-14 15:28
 */
//@FeignClient("service-vod")不用熔断机制的写法
//不需要实现类，此接口远程调用：/eduvod/video/removeAiyVideo/{id}..fallback兜底，出错时执行
@FeignClient(name = "service-order", fallback = orderFeignClient.class)//用于指定从哪个服务(删除视频的服务)中调用功能 ，名称与被调用的服务名保持一致
@Component//防止在其他位置注入CodClient时idea报错
public interface OrdersClient {
    //根据课程id和用户id查询订单表中的订单状态
    @GetMapping("/eduorder/order/isBuyCourse/{courseId}/{memberId}")
    public boolean isBuyCourse(@PathVariable("courseId") String courseId, @PathVariable("memberId") String memberId);

}
